package com.situ.study.day9.inter;

public class Demo {

    public static void main(String[] args) {
        DaYan daYan = new DaYan();
        daYan.egg();
        daYan.fly();
        daYan.print();

        // bird是站在AbstractBird这个类角度去看new出来的DaYan这个对象，
        // 所以只能看到egg()这个方法
        AbstractBird bird = new DaYan();
        bird.egg();
        //bird.fly();
        //bird.print();

        IFly fly = new DaYan();
        fly.fly();


    }

    public void fly(IFly fly) {
        fly.fly();
    }
}
